package cn.wsh.org.common;

/**
 * @ClassName : ResultEnum
 * Author : "吴----"
 * @date : 2022/2/8 21:10
 */
public enum ResultEnum {

    UNKOWN_ERROR(-1,"未知错误"),
    SUCCESS(0,"成功");

    private Integer code;
    private String msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static String getMsg(int code) {
        for (ResultEnum ele : values()) {
            if(ele.getCode().equals(code)) return ele.getMsg();
        }
        return null;
    }
}
